package uiTest;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
 
public class TableEditRx {
    private JScrollPane getContent() {
        JTable table = new JTable(getModel());
        table.setRowHeight(35);
        table.setFont(table.getFont().deriveFont(24f));
        JTextField textField = new JTextField();
        textField.setFont(table.getFont());
        DefaultCellEditor editor = new DefaultCellEditor(textField);
        table.setDefaultEditor(String.class, editor);
        table.setCellSelectionEnabled(true);
        return new JScrollPane(table);
    }
 
    private DefaultTableModel getModel() {
        int rows = 12, cols = 3;
        Object[][] data = new Object[rows][cols];
        for(int j = 0; j < rows; j++)
            for(int k = 0; k < cols; k++)
                data[j][k] = String.valueOf(j+1) + (k+1);
        String[] colIds = { "Column 1", "Column 2", "Column 3" };
        return new DefaultTableModel(data, colIds) {
            public Class getColumnClass(int col) {
                return getValueAt(0, col).getClass();
            }
        };
    }
 
    public static void main(String[] args) {
        JOptionPane.showMessageDialog(null,
                    new TableEditRx().getContent(),
                    "", JOptionPane.PLAIN_MESSAGE);
    }
}

